__author__ = 'Brandon Corfman'
import textwrap
import term

def display():
    term.clear()
    print_page_1()
    term.wait_for_enter_key()
    term.clear()
    print_page_2()
    term.wait_for_enter_key()

def print_page_1():
    ins = "   At the beginning of the game, there is one start card showing a four-way path (shown as a "
    ins += chr(0x253C)
    ins += ") and three hidden goal cards (shown as a ?). On each turn, a player must either add a path "
    ins += "card to the maze, or play an action card, or discard a card from their hand. After that, "
    ins += "if there are any cards in the draw pile, a new card is automatically added to the player's "
    ins += "hand. This ends the turn, and play passes to the next player."
    print(textwrap.fill(ins))
    print()
    ins = "   Bit by bit, path cards form a way from the start card to the goal cards. A path card must "
    ins += "always be put next to a path card that is already on the board. The path cards on all sides "
    ins += "of the card must fit those already in play. The gold-diggers will try to establish an "
    ins += "uninterrupted path from the start card to one of the goal cards; the saboteurs will try to "
    ins += "prevent just that. However, they should not do so too obviously; otherwise, they will be "
    ins += "unmasked very quickly."
    print(textwrap.fill(ins))
    print()
    ins = "   Playing an action card can cause players to hinder or help each other, take a card out "
    ins += "of the pathway maze, or gain information about the goal cards."
    print(textwrap.fill(ins))
    print()
    ins = "   A BrokenTool card will keep another player from playing a path card until it is repaired. "
    ins += "At any time, a maximum of three BrokenTool cards may be used against a particular player, "
    ins += "but only one card of each type."
    print(textwrap.fill(ins))
    print()
    ins = "   A Repair card is used to fix broken tools. You can play one of these cards for yourself or "
    ins += "for a fellow player."
    print(textwrap.fill(ins))
    print()
    ins = "   A RockFall card is allows you to take another path card of your choice (except the start "
    ins += "and goal cards) out of the maze of pathways. A saboteur can thus interrupt a path from the "
    ins += "start towards a goal; a gold-digger can take out a dead end, providing a new chance for a "
    ins += "path. Gaps created in this way can be filled in with fitting path cards on following turns."
    print(textwrap.fill(ins))
    print()

def print_page_2():
    ins = "   A Peek card allows a player to look at a goal card and see whether it contains treasure. "
    ins += "Once a goal is revealed, the player now knows whether or not it is worth digging a path to "
    ins += "this particular goal card, for only one of the three shows the treasure."
    print(textwrap.fill(ins))
    print()
    ins = "   If a player cannot or does not want to play a card, he must discard."
    print(textwrap.fill(ins))
    print()
    ins = "   When a player plays a path card that reaches a goal and creates an uninterrupted path from "
    ins += "the start to this goal, the goal will be revealed. If the goal contains the treasure, the "
    ins += "round is over. If the goal is a stone, the round continues. The round also ends if the draw "
    ins += "pile is used up, and each player has passed."
    print(textwrap.fill(ins))
    print()
    ins = "   The gold-diggers win the round if a path is created from the start to the treasure. Gold is "
    ins += "distributed among the diggers according to gold cards (one for each digger) with a certain "
    ins += "number of nuggets on each card."
    print(textwrap.fill(ins))
    print()
    ins = "   The saboteurs have won the round if the treasure cannot be reached, or the draw pile is "
    ins += "depleted and everyone has passed. If there was one saboteur, he receives 4 gold nuggets. "
    ins += "If there were two or three saboteurs, each gets 3 gold nuggets; if there were four saboteurs, "
    ins += "each gets 2 nuggets. In a three- or four-player game, there may be no saboteurs, in which "
    ins += "case no nuggets are handed out."
    print(textwrap.fill(ins))
    print()
    ins = "   The game ends after the third round. The player with the most gold nuggets wins the game. "
    ins += "If there is more than one player with the same number of nuggets, they are tied in first "
    ins += "place."
    print(textwrap.fill(ins))
    print()